package com.qunar.wan.email;

import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.JavaMailSenderImpl;

/**
 * User: tongjie.yang Date: 13-11-29 Time: 下午3:14
 */
public class JavaMailFactory {

    private static JavaMailSenderImpl senderImpl = new JavaMailSenderImpl();

    static {
        senderImpl.setHost(EmailEntity.EMAIL_HOST);
        senderImpl.setUsername(EmailEntity.EMAIL_USERNAME);
        senderImpl.setPassword(EmailEntity.EMAIL_PASSWORD);
        senderImpl.setJavaMailProperties(EmailEntity.properties);
    }

    public static JavaMailSender getJavaMail() {
        return senderImpl;
    }

}
